package com.zdlog.ler.controller;

import com.zdlog.ler.Resp.object.ResponeMessage;
import com.zdlog.ler.Resp.util.ResponeMessageUtil;
import com.zdlog.ler.service.LerSchoolService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: ler-fast
 * @description:
 * @author: tengxianchao
 * @email: admin@zdlog.com
 * @create: 2018-11-23 15:28
 **/
@RestController
@RequestMapping("/school")
@Slf4j
public class LerSchoolController {


    @Autowired
    private LerSchoolService lerSchoolService;



    @GetMapping("/selectSchool")
    public ResponeMessage selectSchool(@RequestParam("cityCode") String cityCode) {
        return ResponeMessageUtil.success(lerSchoolService.findByCityCode(cityCode));
    }



    @GetMapping("/all")
    public ResponeMessage selectAll() {
        return ResponeMessageUtil.success(lerSchoolService.findAll());
    }


}
